﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.ServiceProcess;
using System.Threading.Tasks;

namespace WebMonitorService
{
    [RunInstaller(true)]
    public partial class ProjectInstaller : System.Configuration.Install.Installer
    {
        public ProjectInstaller()
        {
            InitializeComponent(); serviceInstaller1.ServiceName = "WebMonitorService";

            // 配置 serviceProcessInstaller1
            serviceProcessInstaller1.Account = ServiceAccount.LocalSystem; // 设置服务运行账户
            serviceProcessInstaller1.Username = null; // 如果使用自定义账户，设置用户名
            serviceProcessInstaller1.Password = null; // 如果使用自定义账户，设置密码

            // 配置 serviceInstaller1
            serviceInstaller1.ServiceName = "WebMonitorService"; // 服务名称
            serviceInstaller1.DisplayName = "Web Monitor Service"; // 显示名称
            serviceInstaller1.Description = "A service that monitors a web page at regular intervals."; // 服务描述
            serviceInstaller1.StartType = ServiceStartMode.Automatic; // 设置启动类型（自动、手动、禁用）
        }
    }
}
